"""
selenium使用js代码
"""
import time

from selenium import webdriver

driver=webdriver.Chrome()
driver.get("https://www.baidu.com")
driver.execute_script('document.getElementById("kw").value="selenium"')
driver.execute_script('document.getElementById("su").click()')
time.sleep(3)
driver.close()